#include "session.h"
#include "log.h"
#include <boost/bind.hpp>

namespace base {

	Session::Session()
	{
	}

	Session::~Session()
	{
	}

	void Session::proc( const char* data, size_t size )
	{
		PROTO_HEAD* head = (PROTO_HEAD *)data;
		Protocol* proto = _cmdmapping.getProtocol(head->cmd);
		if (NULL == proto) {
			LOG_DEBUG("Unkown Protocol");
			return;
		}
		LOG_DEBUG("Session : CMDType[" << head->cmd << "] Length[" << head->len <<"]");
		proto->decode(data+sizeof(PROTO_HEAD), size-sizeof(PROTO_HEAD));
	}


	void Session::procHeartBeat()
	{

	}

	void Session::procProtocol()
	{

	}
}
